<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<form id="SystemUsers_form">
    帐号：<input name="userName" type="text" placeholder="请输入帐号/手机号/邮箱"
              maxlength="11">
    密码：<input name="userPassword" type="password" placeholder="请输入密码" maxlength="16">
    <button type="button" id="register">注册</button>
    <button id="login_btn" type="button">登录</button>
</form>
<script src="style/js/jquery3.6.js"></script>
<script>
    $("#login_btn").click(function () {
        $.ajax({
            type: "post",
            url: "UserController/login",
            data: $("#SystemUsers_form").serialize(),
            dataType: "json",
            success: function (data) {
                console.log(data);
                if (data.message == '登录成功')
                    location.href = "buba/index.html";
            }
        })
    })
    $("#register").click(function () {
        location.href = "register.html";
    })
</script>
</body>
</html>